<%@ page language="Java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<html>
  <head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">    
    <title>简单加速器</title>        
 </head>
 <body>
 	<jsp:useBean id="calBean" class="example.bean.learn.CalBean"></jsp:useBean>  
    <jsp:setProperty property="*" name="calBean"/>  
    <%  
      calBean.calculate();  
     %>  
  
    <form action="cal.jsp" method="post">  
        <input type="text" name="firstParam" >  
         <select  
            name="operator">  
            <option value="+">+</option>  
            <option value="-">-</option>  
            <option value="*">*</option>  
            <option value="/">/</option>  
        </select>   
        <input type="text" name="secondParam" />   
        =<button type="submit">计算</button>  
    </form><br>  
      
    计算结果是：  
    <jsp:getProperty property="firstParam" name="calBean"/>  
    <jsp:getProperty property="operator" name="calBean"/>  
    <jsp:getProperty property="secondParam" name="calBean"/>  
    =<jsp:getProperty property="result" name="calBean"/>
 </body>
</html>